﻿namespace OA.DAL.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class seeds : DbMigration
    {
        public override void Up()
        {
            RenameTable(name: "dbo.SysRoleSysPersons", newName: "SysPersonSysRoles");
            RenameTable(name: "dbo.SysActionSysRoles", newName: "SysRoleSysActions");
            DropPrimaryKey("dbo.SysPersonSysRoles");
            DropPrimaryKey("dbo.SysRoleSysActions");
            AddPrimaryKey("dbo.SysPersonSysRoles", new[] { "SysPerson_Id", "SysRole_Id" });
            AddPrimaryKey("dbo.SysRoleSysActions", new[] { "SysRole_Id", "SysAction_Id" });
        }
        
        public override void Down()
        {
            DropPrimaryKey("dbo.SysRoleSysActions");
            DropPrimaryKey("dbo.SysPersonSysRoles");
            AddPrimaryKey("dbo.SysRoleSysActions", new[] { "SysAction_Id", "SysRole_Id" });
            AddPrimaryKey("dbo.SysPersonSysRoles", new[] { "SysRole_Id", "SysPerson_Id" });
            RenameTable(name: "dbo.SysRoleSysActions", newName: "SysActionSysRoles");
            RenameTable(name: "dbo.SysPersonSysRoles", newName: "SysRoleSysPersons");
        }
    }
}
